/* ==================== 字体定义 ==================== */
@font-face {
    font-family: 'WanXinXiMingTi';
    src: url('src/wanxinximingti.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'WanXinXiMingTi', 'PMingLiU-ExtB', 'PMingLiU', 'Microsoft YaHei', 'SimSun', sans-serif;
}

body {
    background: #000;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

body::before {
    display: none;
}

.container {
    width: auto;
    aspect-ratio: 9 / 16;
    height: min(calc(100vh - 40px), calc((100vw - 40px) * 16 / 9));
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    position: relative;
    z-index: 1;
    backdrop-filter: none;
    border: none;
}

/* ==================== 页面基础样式 ==================== */
.page {
    display: none !important;
    padding: 40px 30px;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease-out;
}

.page.active {
    display: block !important;
    opacity: 1;
}

/* ==================== 页面切换动画 ==================== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.page.slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 题目内容动画 ==================== */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-container.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

.question-container.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* ==================== 欢迎页和结果页 ==================== */
#start-page,
#result-page {
    position: relative;
    padding: 0;
}

#start-page.active,
#result-page.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* 全屏图片样式（欢迎页和结果页共用） */
.start-image,
.result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.start-image {
    cursor: pointer;
}

/* ==================== 按钮样式 ==================== */
.btn-start,
.btn-restart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-start {
    padding: 18px 50px;
    font-size: 1.2em;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-restart {
    padding: 15px 45px;
    font-size: 1.1em;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-start::before,
.btn-restart::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-start:hover::before,
.btn-restart:hover::before {
    width: 300px;
    height: 300px;
}

.btn-start:hover,
.btn-restart:hover {
    transform: translateY(-3px);
}

.btn-start:hover {
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.btn-restart:hover {
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.6);
}

.btn-start:active,
.btn-restart:active {
    transform: translateY(-1px);
}

.btn-start:active {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-restart:active {
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* ==================== 渐变文字样式 ==================== */
.gradient-text,
.start-content h1,
.result-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.start-content h1 {
    font-size: 2.5em;
    color: #d32f2f;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

.result-title {
    font-size: 2.2em;
    margin-bottom: 20px;
}

.start-content .intro {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 40px;
    font-weight: 500;
}

/* ==================== 答题页面 ==================== */
#question-page {
    position: relative;
    padding: 40px 30px;
}

#question-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

.question-container {
    padding-top: 4vh;
    position: relative;
    z-index: 1;
}

.question-header {
    color: #ffffff;
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.question-title {
    font-size: 1em;
    color: #ffffff;
    margin-bottom: 35px;
    line-height: 1.6;
    font-weight: 400;
}

.options-container {
     
    display: flex;
    flex-direction: column;
   
}

.option-item {
    background: transparent;
    border: none;
    border-radius: 15px;
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.2em;
    color: #ffffff;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
}

.option-letter {
    font-size: 1.2em;
    font-weight: 700;
    color: #ffffff;
    min-width: 35px;
    width: 35px;
    text-align: center;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    color: #ffffff;
}

.option-item:hover:not(:active) {
    transform: translateX(5px);
}

.option-item.selected {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== 结果页面 ==================== */
.result-content {
    text-align: center;
    padding: 40px 20px;
}

.result-icon {
    font-size: 6em;
    margin-bottom: 20px;
    animation: resultBounce 1.5s ease-in-out;
    display: inline-block;
}

@keyframes resultBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-30px) scale(1.1); }
    50% { transform: translateY(-20px) scale(1.05); }
    75% { transform: translateY(-10px) scale(1.02); }
}

.result-description {
    font-size: 1.15em;
    color: #555;
    line-height: 2;
    margin-bottom: 40px;
    padding: 0 20px;
    font-weight: 500;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .container {
        max-width: 100%;
        border-radius: 15px;
    }

    .start-content h1 {
        font-size: 2em;
    }

    .question-header {
        font-size: 2.1em;
    }

    .question-title {
        font-size: 1em;
    }

    .option-item {
        padding: 10px 15px;
        font-size: 1.2em;
    }

    .result-icon {
        font-size: 5em;
    }

    .result-title {
        font-size: 1.9em;
    }

    .result-description {
        font-size: 1.05em;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
        width: 100vw;
        aspect-ratio: auto;
        overflow-y: auto;
        border: none;
        box-shadow: none;
        background: #000;
    }

    .page {
        padding: 25px 20px;
    }

    #start-page,
    #result-page {
        padding: 0;
    }

    .start-content {
        padding: 30px 15px;
    }

    .start-content h1 {
        font-size: 1.8em;
    }

    .start-content .intro {
        font-size: 1.05em;
    }

    .btn-start {
        padding: 15px 40px;
        font-size: 1.1em;
    }

    .question-header {
        font-size: 2em;
        margin-bottom: 15px;
    }

    .question-title {
        font-size: 1em;
        margin-bottom: 25px;
    }

    .option-item {
        padding: 8px 12px;
        font-size: 1.2em;
    }

    .result-icon {
        font-size: 4.5em;
    }

    .result-title {
        font-size: 1.6em;
    }

    .result-description {
        font-size: 1em;
        line-height: 1.7;
    }

    .btn-restart {
        padding: 13px 35px;
        font-size: 1em;
    }
}
